#!/usr/bin/env bash

docker-compose up -d
# 休眠10秒，避免容器未完全启动
date;sleep 10s;date

# 插件安装加速配置
defaultJsonFilePath=${PWD}/home/updates/default.json
sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' ${defaultJsonFilePath}
sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g'${defaultJsonFilePath}

docker-compose restart
echo "Jenkins默认密码如下："
cat ${PWD}/home/secrets/initialAdminPassword
